package com.zzh.tree;

public class No101_isSymmetric {
    public static void main(String[] args) {

    }
}

class No101Solution {
    public boolean isSymmetric(TreeNode root) {
        if (root==null) {
            return true;
        }
        return isSymmetric(root.left,root.right);
    }
    public boolean isSymmetric(TreeNode root1,TreeNode root2){
        if (root1==null&&root2==null){
            return true;
        }
        if (root1==null||root2==null){
            return false;
        }
        if (root1.val!=root2.val){
            return false;
        }
        //完完全全利用相同树来判断
        return isSymmetric(root1.left,root2.right)&&isSymmetric(root1.right,root2.left);

    }
}
